#!/bin/bash

cd $(dirname $0)

APK_VER=$(cat app/build.gradle|grep versionName|head -n 1|awk '{print $2}'|sed -e 's/"//g')
echo "APK version: $APK_VER"

bash gradlew clean assembleDebug

for OUTPUT in $(find . -name "*.apk"); do
  echo "apk: $OUTPUT ..."
done

rm *.apk
find . -name "*.apk" -exec mv -vf {} . \;